package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.admin.WorkspaceService;
import com.sky.vo.*;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/workspace")
public class WorkspaceController{
    private final WorkspaceService workspaceService;
    /**
     * 获取营业数据
     * @return
     */
    @GetMapping("/businessData")
    public Result<BusinessDataVO> getBusinessData(){
        BusinessDataVO businessData = workspaceService.getBusinessData();
        return Result.success(businessData);
    }

    /**
     * 获取菜品总览
     * @return
     */
    @GetMapping("/overviewDishes")
    public Result<DishOverViewVO> getDishOverView(){
        DishOverViewVO dishOverView = workspaceService.getDishOverView();
        return Result.success(dishOverView);
    }

    /**
     * 获取套餐总览
     * @return
     */
    @GetMapping("/overviewSetmeals")
    public Result<SetmealOverViewVO> getSetmealOverView(){
        SetmealOverViewVO setmealOverView = workspaceService.getSetmealOverView();
        return Result.success(setmealOverView);
    }


    /**
     * 获取订单总览
     * @return
     */
    @GetMapping("/overviewOrders")
    public Result<OrderOverViewVO> getOrderOverView(){
        OrderOverViewVO orderOverView = workspaceService.getOrderOverView();
        return Result.success(orderOverView);
    }

}
